package com.eliza.base.viewrouter

import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.rounded.Send
import androidx.compose.material.icons.rounded.Notifications
import androidx.compose.material.icons.rounded.ShoppingCart
import androidx.compose.material.icons.rounded.ThumbUp
import androidx.compose.material.icons.sharp.ShoppingCart
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.navigation.NavController
import androidx.navigation.NavGraphBuilder
import androidx.navigation.NavHostController
import androidx.navigation.compose.composable
import androidx.navigation.compose.navigation
import com.eliza.base.views.learn.animation.LearnAnimationScreen
import com.eliza.base.views.learn.collect.LearnCollectScreen
import com.eliza.base.views.learn.gestures.LearnGesturesScreen
import com.eliza.base.views.learn.graphics.LearnGraphicsScreen
import com.eliza.base.views.learn.layouts.LayoutX
import com.eliza.base.views.learn.text.TextX
import com.eliza.base.views.learn.widget.LearnGlanceScreen
import com.eliza.library.ui.inter.IBaseRoute
import com.eliza.library.ui.inter.INavScreen

enum class NavLearnEnum(
    override val title: String,
    override val imageVector: ImageVector,
    override val content: @Composable (NavController) -> Unit
) : IBaseRoute {
    Layouts("Layouts", Icons.AutoMirrored.Rounded.Send, { LayoutX.Show(it) }),
    Text("Text", Icons.Rounded.ShoppingCart, { TextX.Show(it) }),
    Icon("Graphics", Icons.Rounded.Notifications, { LearnGraphicsScreen(it) }),
    Collect("Collect", Icons.Sharp.ShoppingCart, { LearnCollectScreen(it) }),
    Animation("Animation", Icons.Sharp.ShoppingCart, { LearnAnimationScreen(it) }),
    Gestures("Gestures", Icons.Rounded.ThumbUp, { LearnGesturesScreen(it) }),
    Glance("Glance", Icons.Rounded.ThumbUp, { LearnGlanceScreen(it) }),
    ;

    companion object : INavScreen {
        override fun RegisterRoute(navController: NavHostController,nav: NavGraphBuilder) {
            nav.navigation(
                startDestination = Layouts.title,
                route = "NavLearnEnum"
            ) {
                NavLearnEnum.entries.forEach { route ->
                    // 显示添加导航参数 (参数列表)
                    composable(route.title) {
                        route.content(navController)
                    }
                }
            }
        }
    }

}

